﻿///* Copyright (C) 2022 Dylan Cheng (https://github.com/newlooper)

//This file is part of VirtualSpace.

//VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

//VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

//You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see <https://www.gnu.org/licenses/>.
//*/


//namespace VirtualDesktop.Api
//{
//    public static partial class DesktopManagerWrapper
//    {
//        public static Guid GetIdByIndex(int index)
//        {
//            try
//            {
//                if (SysInfo.IsWin10)
//                {
//                    return VirtualDesktop10::VirtualDesktop.DesktopManager.GetDesktop(index).GetId();
//                }

//                return VD11::VirtualDesktop.DesktopManager.GetDesktop(index).GetId();
//            }
//            catch
//            {
//                return default;
//            }
//        }

//        public static int GetViewCount()
//        {
//            if (SysInfo.IsWin10)
//            {
//                return VirtualDesktop10::VirtualDesktop.DesktopManager.GetViewCount();
//            }
//            var locakVer = GetWin11Type();
//            switch (locakVer)
//            {
//                case Win11_Type.Win11:
//                    return VD11::VirtualDesktop.DesktopManager.GetViewCount();
//                case Win11_Type.Win11_23H2:
//                    return VD11::VirtualDesktop.DesktopManager.GetViewCount();
//                case Win11_Type.Win11_23H2_3085:
//                    return VD11::VirtualDesktop.DesktopManager.GetViewCount();
//                default:
//                    return VirtualDesktop10::VirtualDesktop.DesktopManager.GetViewCount();
//            }
//        }

//        public static void ResetDesktopManager()
//        {
//            if (SysInfo.IsWin10)
//            {
//                VirtualDesktop10::VirtualDesktop.DesktopManager.ResetDesktopManager();
//            }
//            else
//            {
//                VD11::VirtualDesktop.DesktopManager.ResetDesktopManager();
//            }
//        }

//        static Win11_Type Local_Win11_Type = Win11_Type.None;
//        public static Win11_Type GetWin11Type()
//        {
//            if (SysInfo.IsWin10) return Win11_Type.None;
//            if (Local_Win11_Type != Win11_Type.None)
//                return Local_Win11_Type;
//            try
//            {
//                VD11::VirtualDesktop.DesktopManager.ResetDesktopManager();
//                Local_Win11_Type = Win11_Type.Win11;
//                return Local_Win11_Type;
//            }
//            catch (Exception)
//            {
//            }

//            try
//            {
//                VD11_23H2::VirtualDesktop.DesktopManager.ResetDesktopManager();
//                Local_Win11_Type = Win11_Type.Win11_23H2;
//                return Local_Win11_Type;
//            }
//            catch (Exception)
//            {
//            }

//            try
//            {
//                VD11_23H2_3085::VirtualDesktop.DesktopManager.ResetDesktopManager();
//                Local_Win11_Type = Win11_Type.Win11_23H2_3085;
//                return Local_Win11_Type;
//            }
//            catch (Exception)
//            {
//            }
//            return Win11_Type.None;
//        }

//        public enum Win11_Type
//        {
//            None = 0,
//            Win11 = 1,
//            Win11_23H2 = 2,
//            Win11_23H2_3085 = 3,
//        }
//    }
//}